refactor(models): 重构主模型设置流程与同步渲染机制#254
Merged
1186258278 merged 2 commits intoqingchencloud:mainfrom Apr 26, 2026
Merged
Conversation
设为主模型时统一走 setPrimary 后,fallback 链轮转需要额外处理历史异常配置: - 过滤已不存在的模型,避免删除旧主模型后又被塞回 fallback 链 - 对 fallback 链去重,避免旧配置中已有重复项时继续放大重复 - 保持新主模型从 fallback 链中移除、旧主模型降级到链尾的原设计
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本次提交重构了模型管理页面的状态流转逻辑,以降低业务侵入性并提升UI同步的健壮性。
核心变更
1. 状态流转机制重构与解耦:
setPrimary函数:将原来散落在特定 UI 按钮点击事件中的“备选链轮转”业务逻辑抽离,封装出独立的rotateFallbackChain处理流程。setPrimary。这不仅清除了多余的面条代码,更彻底解决了由于逻辑遗漏导致的数据污染(切换主模型时,旧模型凭空消失、新模型未能从备选链中剔除,进而导致页面重载时状态被修正机制复原的问题)。2. 响应式双向渲染同步:
renderProviders和renderDefaultBar。